﻿using System;
using System;
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
using netDxf;
using netDxf.Blocks;
using netDxf.Collections;
using netDxf.Entities;
using netDxf.Header;
using netDxf.Objects;
using netDxf.Tables;
using netDxf.Units;
using Attribute = netDxf.Entities.Attribute;
using Image = netDxf.Entities.Image;
using Point = netDxf.Entities.Point;
using Trace = netDxf.Entities.Trace;
using System.Threading;

namespace TestDxfDocument
{

    class Threadendmillwithdrillingpartsolid
    {
        public static void _Threadendmillwithdrillingpartsolid(Dictionary<string, Object> data)//细柄丝锥
        {
            DxfDocument dxf = new DxfDocument();
            //图层
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层
            Layer dimensioning = new Layer("dimensioning");    //尺寸层
            Layer refin = new Layer("refin") { Color = AciColor.Red };    //基准线/内轮廓
            refin.Linetype = Linetype.Dashed;
            Layer centre = new Layer("centre") { Color = AciColor.Yellow };    //中心线
            Layer textlayer = new Layer("textlayer") { Color = AciColor.Blue };    //文本层
            Layer hatching = new Layer("hatching") { Color = AciColor.Blue };    //填充层
            centre.Linetype = Linetype.DashDot;
            Layer additionalline = new Layer("additionalline") { Color = AciColor.Cyan };    //附加线
            Layer cutting = new Layer("cutting") { Color = AciColor.Red };    //切削层
            Layer nocutting = new Layer("nocutting");    //非切削层
            Layer skcontour = new Layer("skcontour") { Color = AciColor.Cyan };    //sk轮廓层
            Layer skdimensioning = new Layer("skdimensioning");    //sk尺寸线层
            Layer skrefin = new Layer("skrefin") { Color = AciColor.Red };    //sk基准线/内轮廓
            Layer sktext = new Layer("sktext") { Color = AciColor.Blue };  //sk文本
            Layer skhatching = new Layer("skhatching") { Color = AciColor.Blue };    //sk填充
            Layer skadditionlline = new Layer("skadditionlline") { Color = AciColor.Cyan };    //sk附加线
            Layer skviewcontour = new Layer("skviewcontour") { Color = AciColor.Cyan };    //skview轮廓
            Layer skviewdimensioning = new Layer("skviewdimensioning");    //skview尺寸线层

            //参数
            double pi = Math.PI;
            string path = Convert.ToString(data["path"]);

            double scale = 2; //放大系数

            double oal = 35.72;
            double lpr = 26.1;
            double dconms = 6.58;
            double ls = 11.8;
            double dc = 7.21;
            double dn = 5.45;
            double tp = 1.15;
            double sig = 102;
            double lu = 23.47;


            //坐标
            Vector2 v1 = new Vector2(0, 0);
            Vector2 v2 = new Vector2(v1.X + oal + 4, v1.Y);
            Vector2 v3 = new Vector2(v1.X + 2, v1.Y);
            Vector2 v4 = new Vector2(v3.X, v3.Y + dconms / 2 - 0.4);
            Vector2 v5 = new Vector2(v4.X + 0.4, v4.Y + 0.4);
            Vector2 v6 = new Vector2(v3.X + ls, v5.Y);
            Vector2 v7 = new Vector2(v6.X + 0.6, v3.Y + dn / 2);
            Vector2 v8 = new Vector2(v7.X, v7.Y * -1);
            Vector2 v9 = new Vector2(v6.X, v6.Y * -1);
            Vector2 v10 = new Vector2(v5.X, v5.Y * -1);
            Vector2 v11 = new Vector2(v4.X, v4.Y * -1);
            Vector2 v12 = new Vector2(v3.X + oal, v3.Y);
            Vector2 v13 = new Vector2(v12.X - dc / 2 / Math.Tan(sig / 2 * pi / 180), v12.Y + dc / 2);
            Vector2 v14 = new Vector2(v13.X - lu / 21.336, v13.Y);
            Vector2 v15 = new Vector2(v14.X - tp / 2, v14.Y - dc / 11.629);
            Vector2 v16 = new Vector2(v14.X - tp, v14.Y);
            Vector2 v17 = new Vector2(v15.X - tp, v15.Y);
            Vector2 v18 = new Vector2(v16.X - tp, v16.Y);
            Vector2 v19 = new Vector2(v17.X - tp, v17.Y);
            Vector2 v20 = new Vector2(v18.X - tp, v18.Y);
            Vector2 v21 = new Vector2(v19.X - tp, v19.Y);
            Vector2 v22 = new Vector2(v20.X - tp, v20.Y);
            Vector2 v23 = new Vector2(v21.X - tp, v21.Y);
            Vector2 v24 = new Vector2(v22.X - tp, v22.Y);
            Vector2 v25 = new Vector2(v23.X - tp, v23.Y);
            Vector2 v26 = new Vector2(v24.X - tp, v24.Y);
            Vector2 v27 = new Vector2(v25.X - tp, v12.Y + dn / 2);
            Vector2 v28 = new Vector2(v13.X, v13.Y * -1);
            Vector2 v29 = new Vector2(v14.X, v14.Y * -1);
            Vector2 v30 = new Vector2(v15.X, v15.Y * -1);
            Vector2 v31 = new Vector2(v16.X, v16.Y * -1);
            Vector2 v32 = new Vector2(v17.X, v17.Y * -1);
            Vector2 v33 = new Vector2(v18.X, v18.Y * -1);
            Vector2 v34 = new Vector2(v19.X, v19.Y * -1);
            Vector2 v35 = new Vector2(v20.X, v20.Y * -1);
            Vector2 v36 = new Vector2(v21.X, v21.Y * -1);
            Vector2 v37 = new Vector2(v22.X, v22.Y * -1);
            Vector2 v38 = new Vector2(v23.X, v23.Y * -1);
            Vector2 v39 = new Vector2(v24.X, v24.Y * -1);
            Vector2 v40 = new Vector2(v25.X, v25.Y * -1);
            Vector2 v41 = new Vector2(v26.X, v26.Y * -1);
            Vector2 v42 = new Vector2(v27.X, v27.Y * -1);
            Vector2 v43 = new Vector2(v29.X, v29.Y + dc / 7.357);
            Vector2 v44 = new Vector2(v30.X, v30.Y + dc / 7.357);
            Vector2 v45 = new Vector2(v31.X, v31.Y + dc / 7.357);
            Vector2 v46 = new Vector2(v32.X, v32.Y + dc / 7.357);
            Vector2 v47 = new Vector2(v33.X, v33.Y + dc / 7.357);
            Vector2 v48 = new Vector2(v34.X, v34.Y + dc / 7.357);
            Vector2 v49 = new Vector2(v35.X, v35.Y + dc / 7.357);
            Vector2 v50 = new Vector2(v36.X, v36.Y + dc / 7.357);
            Vector2 v51 = new Vector2(v37.X, v37.Y + dc / 7.357);
            Vector2 v52 = new Vector2(v38.X, v38.Y + dc / 7.357);
            Vector2 v53 = new Vector2(v39.X, v39.Y + dc / 7.357);
            Vector2 v54 = new Vector2(v40.X, v40.Y + dc / 7.357);
            Vector2 v55 = new Vector2(v41.X, v41.Y + dc / 7.357);
            Vector2 v56 = new Vector2(v12.X - lpr, v12.Y);
            Vector2 v57 = new Vector2(v56.X, v56.Y + dconms / 2 + 1);
            Vector2 v58 = new Vector2(v56.X, v56.Y - dconms / 2 - 1);
            Vector2 v59 = new Vector2(v14.X, v12.Y);
            Vector2 v60 = fun.Polar(v59, -176 * pi / 180, lu / 1.778);
            Vector2 v61 = new Vector2(v60.X + lu / 12.353, v42.Y);
            Vector2 v62 = new Vector2(v59.X, v59.Y + dc / 3.755);
            Vector2 v63 = new Vector2(v15.X, v62.Y - dc / 23.258);
            Vector2 v64 = new Vector2(v16.X, v62.Y);
            Vector2 v65 = new Vector2(v17.X, v63.Y);
            Vector2 v66 = new Vector2(v18.X, v64.Y);
            Vector2 v67 = new Vector2(v19.X, v65.Y);
            Vector2 v68 = new Vector2(v20.X, v62.Y);
            Vector2 v69 = new Vector2(v21.X, v63.Y);
            Vector2 v70 = new Vector2(v22.X, v62.Y);
            Vector2 v71 = new Vector2(v23.X, v63.Y);
            Vector2 v72 = new Vector2(v24.X, v62.Y);
            Vector2 v73 = new Vector2(v25.X, v63.Y);
            Vector2 v74 = new Vector2(v26.X, v62.Y);
            Vector2 v75 = new Vector2(v27.X, v63.Y);
            Vector2 v76 = new Vector2(v75.X - lu / 7.62, v75.Y);
            Vector2 v77 = new Vector2(v60.X, v27.Y);
            Vector2 v78 = fun.Polar(v59, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));
            Vector2 v79 = fun.Polar(v78, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));
            Vector2 v80 = fun.Polar(v79, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));
            Vector2 v81 = fun.Polar(v80, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));
            Vector2 v82 = fun.Polar(v81, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));
            Vector2 v83 = fun.Polar(v82, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));
            Vector2 v84 = fun.Polar(v83, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));
            Vector2 v85 = fun.Polar(v84, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));
            Vector2 v86 = fun.Polar(v85, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));
            Vector2 v87 = fun.Polar(v86, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));
            Vector2 v88 = fun.Polar(v87, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));
            Vector2 v89 = fun.Polar(v88, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));
            Vector2 v90 = fun.Polar(v89, -176 * pi / 180, tp / 2 / Math.Cos(4 * pi / 180));

            Vector2 v91 = new Vector2(v2.X - oal / 2.864, v2.Y - oal / 1.303);
            Vector2 v92 = new Vector2(v91.X - dc / 2 / Math.Tan(sig / 2 * pi / 180) * scale, v91.Y - dc / 2 * scale);
            Vector2 v93 = new Vector2(v92.X - lu / 21.336 * scale, v92.Y);
            Vector2 v94 = new Vector2(v93.X - tp / 2 * scale, v93.Y + dc / 11.629 * scale);
            Vector2 v95 = new Vector2(v93.X - tp * scale, v93.Y);
            Vector2 v96 = new Vector2(v94.X - tp * scale, v94.Y);
            Vector2 v97 = new Vector2(v95.X - tp * scale, v95.Y);
            Vector2 v98 = new Vector2(v97.X, v97.Y + dc / 7.357 * scale);
            Vector2 v99 = new Vector2(v96.X, v96.Y + dc / 7.357 * scale);
            Vector2 v100 = new Vector2(v95.X, v95.Y + dc / 7.357 * scale);
            Vector2 v101 = new Vector2(v94.X, v94.Y + dc / 7.357 * scale);
            Vector2 v102 = new Vector2(v93.X, v93.Y + dc / 7.357 * scale);
            Vector2 v103 = new Vector2(v102.X, v91.Y);
            Vector2 v104 = new Vector2(v98.X, v103.Y - (v102.X - v98.X) * Math.Tan(4 * pi / 180));
            Vector2 v105 = new Vector2(v91.X - oal / 1.758, v91.Y + oal / 23.5);
            Vector2 v106 = new Vector2(v105.X + oal / 1.398, v105.Y);
            Vector2 v107 = new Vector2(v106.X, v106.Y - oal / 1.816);
            Vector2 v108 = new Vector2(v105.X, v107.Y);




            //作图
            //1
            Line line1 = new Line(v1, v2);
            line1.Layer = centre;
            line1.Linetype = Linetype.DashDot;
            line1.LinetypeScale = 3;
            dxf.AddEntity(line1);

            Line line2 = new Line(v57, v58);
            line2.Layer = centre;
            line2.Linetype = Linetype.DashDot;
            line2.LinetypeScale = 3;
            dxf.AddEntity(line2);

            LwPolyline line3 = new LwPolyline();
            line3.Vertexes.Add(new LwPolylineVertex(v5));
            line3.Vertexes.Add(new LwPolylineVertex(v10));
            line3.Vertexes.Add(new LwPolylineVertex(v11));
            line3.Vertexes.Add(new LwPolylineVertex(v4));
            line3.Vertexes.Add(new LwPolylineVertex(v5));
            line3.Vertexes.Add(new LwPolylineVertex(v6));
            line3.Vertexes.Add(new LwPolylineVertex(v9));
            line3.Vertexes.Add(new LwPolylineVertex(v10));
            fun.PolyFill(dxf, line3, 0.1, contour);

            LwPolyline line4 = new LwPolyline();
            line4.Vertexes.Add(new LwPolylineVertex(v6));
            line4.Vertexes.Add(new LwPolylineVertex(v7));
            line4.Vertexes.Add(new LwPolylineVertex(v8));
            line4.Vertexes.Add(new LwPolylineVertex(v9));
            fun.PolyFill(dxf, line4, 0.1, contour);

            LwPolyline line5 = new LwPolyline();
            line5.Vertexes.Add(new LwPolylineVertex(v7));
            line5.Vertexes.Add(new LwPolylineVertex(v27));
            line5.Vertexes.Add(new LwPolylineVertex(v26));
            line5.Vertexes.Add(new LwPolylineVertex(v25));
            line5.Vertexes.Add(new LwPolylineVertex(v24));
            line5.Vertexes.Add(new LwPolylineVertex(v23));
            line5.Vertexes.Add(new LwPolylineVertex(v22));
            line5.Vertexes.Add(new LwPolylineVertex(v21));
            line5.Vertexes.Add(new LwPolylineVertex(v20));
            line5.Vertexes.Add(new LwPolylineVertex(v19));
            line5.Vertexes.Add(new LwPolylineVertex(v18));
            line5.Vertexes.Add(new LwPolylineVertex(v17));
            line5.Vertexes.Add(new LwPolylineVertex(v16));
            line5.Vertexes.Add(new LwPolylineVertex(v15));
            line5.Vertexes.Add(new LwPolylineVertex(v14));
            line5.Vertexes.Add(new LwPolylineVertex(v13));
            line5.Vertexes.Add(new LwPolylineVertex(v12));
            fun.PolyFill(dxf, line5, 0.1, contour);

            LwPolyline line6 = new LwPolyline();
            line6.Vertexes.Add(new LwPolylineVertex(v12));
            line6.Vertexes.Add(new LwPolylineVertex(v28));
            line6.Vertexes.Add(new LwPolylineVertex(v29));
            line6.Vertexes.Add(new LwPolylineVertex(v30));
            line6.Vertexes.Add(new LwPolylineVertex(v31));
            line6.Vertexes.Add(new LwPolylineVertex(v32));
            line6.Vertexes.Add(new LwPolylineVertex(v33));
            line6.Vertexes.Add(new LwPolylineVertex(v34));
            line6.Vertexes.Add(new LwPolylineVertex(v35));
            line6.Vertexes.Add(new LwPolylineVertex(v36));
            line6.Vertexes.Add(new LwPolylineVertex(v37));
            line6.Vertexes.Add(new LwPolylineVertex(v38));
            line6.Vertexes.Add(new LwPolylineVertex(v39));
            line6.Vertexes.Add(new LwPolylineVertex(v40));
            line6.Vertexes.Add(new LwPolylineVertex(v41));
            line6.Vertexes.Add(new LwPolylineVertex(v42));
            line6.Vertexes.Add(new LwPolylineVertex(v8));
            fun.PolyFill(dxf, line6, 0.1, contour);

            LwPolyline line7 = new LwPolyline();
            line7.Vertexes.Add(new LwPolylineVertex(v29));
            line7.Vertexes.Add(new LwPolylineVertex(v43));
            line7.Vertexes.Add(new LwPolylineVertex(v44));
            line7.Vertexes.Add(new LwPolylineVertex(v30));
            line7.Vertexes.Add(new LwPolylineVertex(v44));
            line7.Vertexes.Add(new LwPolylineVertex(v45));
            line7.Vertexes.Add(new LwPolylineVertex(v31));
            line7.Vertexes.Add(new LwPolylineVertex(v45));
            line7.Vertexes.Add(new LwPolylineVertex(v46));
            line7.Vertexes.Add(new LwPolylineVertex(v32));
            line7.Vertexes.Add(new LwPolylineVertex(v46));
            line7.Vertexes.Add(new LwPolylineVertex(v47));
            line7.Vertexes.Add(new LwPolylineVertex(v33));
            line7.Vertexes.Add(new LwPolylineVertex(v47));
            line7.Vertexes.Add(new LwPolylineVertex(v48));
            line7.Vertexes.Add(new LwPolylineVertex(v34));
            line7.Vertexes.Add(new LwPolylineVertex(v48));
            line7.Vertexes.Add(new LwPolylineVertex(v49));
            line7.Vertexes.Add(new LwPolylineVertex(v35));
            line7.Vertexes.Add(new LwPolylineVertex(v49));
            line7.Vertexes.Add(new LwPolylineVertex(v50));
            line7.Vertexes.Add(new LwPolylineVertex(v36));
            line7.Vertexes.Add(new LwPolylineVertex(v50));
            line7.Vertexes.Add(new LwPolylineVertex(v51));
            line7.Vertexes.Add(new LwPolylineVertex(v37));
            line7.Vertexes.Add(new LwPolylineVertex(v51));
            line7.Vertexes.Add(new LwPolylineVertex(v52));
            line7.Vertexes.Add(new LwPolylineVertex(v38));
            line7.Vertexes.Add(new LwPolylineVertex(v52));
            line7.Vertexes.Add(new LwPolylineVertex(v53));
            line7.Vertexes.Add(new LwPolylineVertex(v39));
            line7.Vertexes.Add(new LwPolylineVertex(v53));
            line7.Vertexes.Add(new LwPolylineVertex(v54));
            line7.Vertexes.Add(new LwPolylineVertex(v40));
            line7.Vertexes.Add(new LwPolylineVertex(v54));
            line7.Vertexes.Add(new LwPolylineVertex(v55));
            line7.Vertexes.Add(new LwPolylineVertex(v41));
            fun.PolyFill(dxf, line7, 0.1, contour);

            LwPolyline line8 = new LwPolyline();
            line8.Vertexes.Add(new LwPolylineVertex(v61));
            line8.Vertexes.Add(new LwPolylineVertex(v60));
            line8.Vertexes.Add(new LwPolylineVertex(v59));
            line8.Vertexes.Add(new LwPolylineVertex(v12));
            line8.Vertexes.Add(new LwPolylineVertex(v62));
            line8.Vertexes.Add(new LwPolylineVertex(v63));
            line8.Vertexes.Add(new LwPolylineVertex(v64));
            line8.Vertexes.Add(new LwPolylineVertex(v65));
            line8.Vertexes.Add(new LwPolylineVertex(v66));
            line8.Vertexes.Add(new LwPolylineVertex(v67));
            line8.Vertexes.Add(new LwPolylineVertex(v68));
            line8.Vertexes.Add(new LwPolylineVertex(v69));
            line8.Vertexes.Add(new LwPolylineVertex(v70));
            line8.Vertexes.Add(new LwPolylineVertex(v71));
            line8.Vertexes.Add(new LwPolylineVertex(v72));
            line8.Vertexes.Add(new LwPolylineVertex(v73));
            line8.Vertexes.Add(new LwPolylineVertex(v74));
            line8.Vertexes.Add(new LwPolylineVertex(v75));
            line8.Vertexes.Add(new LwPolylineVertex(v76));
            line8.Vertexes.Add(new LwPolylineVertex(v77));
            line8.Vertexes[0].Bulge = Math.Tan(-52 * pi / 180 / 4);
            line8.Vertexes[3].Bulge = Math.Tan(43 * pi / 180 / 4);
            line8.Vertexes[18].Bulge = Math.Tan(-52 * pi / 180 / 4);
            fun.PolyFill(dxf, line8, 0.1, contour);

            LwPolyline line9 = new LwPolyline();
            line9.Vertexes.Add(new LwPolylineVertex(v62));
            line9.Vertexes.Add(new LwPolylineVertex(v59));
            line9.Vertexes.Add(new LwPolylineVertex(v78));
            line9.Vertexes.Add(new LwPolylineVertex(v63));
            line9.Vertexes.Add(new LwPolylineVertex(v64));
            line9.Vertexes.Add(new LwPolylineVertex(v79));
            line9.Vertexes.Add(new LwPolylineVertex(v80));
            line9.Vertexes.Add(new LwPolylineVertex(v65));
            line9.Vertexes.Add(new LwPolylineVertex(v66));
            line9.Vertexes.Add(new LwPolylineVertex(v81));
            line9.Vertexes.Add(new LwPolylineVertex(v82));
            line9.Vertexes.Add(new LwPolylineVertex(v67));
            line9.Vertexes.Add(new LwPolylineVertex(v68));
            line9.Vertexes.Add(new LwPolylineVertex(v83));
            line9.Vertexes.Add(new LwPolylineVertex(v84));
            line9.Vertexes.Add(new LwPolylineVertex(v69));
            line9.Vertexes.Add(new LwPolylineVertex(v70));
            line9.Vertexes.Add(new LwPolylineVertex(v85));
            line9.Vertexes.Add(new LwPolylineVertex(v86));
            line9.Vertexes.Add(new LwPolylineVertex(v71));
            line9.Vertexes.Add(new LwPolylineVertex(v72));
            line9.Vertexes.Add(new LwPolylineVertex(v87));
            line9.Vertexes.Add(new LwPolylineVertex(v88));
            line9.Vertexes.Add(new LwPolylineVertex(v73));
            line9.Vertexes.Add(new LwPolylineVertex(v74));
            line9.Vertexes.Add(new LwPolylineVertex(v89));
            line9.Vertexes.Add(new LwPolylineVertex(v90));
            line9.Vertexes.Add(new LwPolylineVertex(v75));
            fun.PolyFill(dxf, line9, 0.1, contour);

            //2
            LwPolyline line10 = new LwPolyline();
            line10.Vertexes.Add(new LwPolylineVertex(v104));
            line10.Vertexes.Add(new LwPolylineVertex(v103));
            line10.Vertexes.Add(new LwPolylineVertex(v91));
            line10.Vertexes.Add(new LwPolylineVertex(v92));
            line10.Vertexes.Add(new LwPolylineVertex(v93));
            line10.Vertexes.Add(new LwPolylineVertex(v94));
            line10.Vertexes.Add(new LwPolylineVertex(v95));
            line10.Vertexes.Add(new LwPolylineVertex(v96));
            line10.Vertexes.Add(new LwPolylineVertex(v97));
            line10.Vertexes.Add(new LwPolylineVertex(v98));
            line10.Vertexes.Add(new LwPolylineVertex(v99));
            line10.Vertexes.Add(new LwPolylineVertex(v100));
            line10.Vertexes.Add(new LwPolylineVertex(v101));
            line10.Vertexes.Add(new LwPolylineVertex(v102));
            line10.Vertexes.Add(new LwPolylineVertex(v93));
            line10.Vertexes.Add(new LwPolylineVertex(v94));
            line10.Vertexes.Add(new LwPolylineVertex(v101));
            line10.Vertexes.Add(new LwPolylineVertex(v100));
            line10.Vertexes.Add(new LwPolylineVertex(v95));
            line10.Vertexes.Add(new LwPolylineVertex(v96));
            line10.Vertexes.Add(new LwPolylineVertex(v99));
            line10.Vertexes.Add(new LwPolylineVertex(v98));
            line10.Vertexes.Add(new LwPolylineVertex(v97));
            fun.PolyFill(dxf, line10, 0.1, contour);

            Line line11 = new Line(v105, v106);
            line11.Layer = refin;
            line11.Linetype = Linetype.Dashed;
            line11.LinetypeScale = 5;
            dxf.AddEntity(line11);

            Line line12 = new Line(v106, v107);
            line12.Layer = refin;
            line12.Linetype = Linetype.Dashed;
            line12.LinetypeScale = 5;
            dxf.AddEntity(line12);

            Line line13 = new Line(v107, v108);
            line13.Layer = refin;
            line13.Linetype = Linetype.Dashed;
            line13.LinetypeScale = 5;
            dxf.AddEntity(line13);

            Line line14 = new Line(v105, v108);
            line14.Layer = refin;
            line14.Linetype = Linetype.Dashed;
            line14.LinetypeScale = 5;
            dxf.AddEntity(line14);


            //坐标系
            fun.Axis(dxf, v3, -90, 180, "", "", "", 0.3, 1, 0);

            fun.Axis(dxf, v56, -90, 180, "", "", "", 0.3, 1, 0);

            fun.Axis(dxf, v12, -90, 180, "", "", "", 0.3, 1, 0);



            //标注

            double height = 2;
            double arrowsize = 2;
            double exline = 2;

            //1
            fun.dimrot1(dxf, v18, v20, 0, oal / 15, 1, height, arrowsize, exline, "TP", "", "");

            fun.dimrot1(dxf, v57, v14, 0, oal / 6, 1, height, arrowsize, exline, "LTA_1", "", "");

            fun.dimrot1(dxf, v57, v13, 0, oal / 3, 1, height, arrowsize, exline, "LTA_2", "", "");

            fun.dimrot1(dxf, v4, v12, 0, oal / 1.5, 1, height, arrowsize, exline, "OAL", "", "");

            fun.dimrot1(dxf, v5, v10, 90, dconms / 2, 1, height, arrowsize, exline, "DCONMS", "", "");

            fun.dimrot1(dxf, v28, v13, -90, dconms * 3 / 2, 1, height, arrowsize, exline, "DC_2", "", "");

            fun.dimrot1(dxf, v7, v8, -90, dconms / 2, 1, height, arrowsize, exline, "DN", "", "");

            fun.dimrot1(dxf, v11, v9, 180, oal / 10, 1, height, arrowsize, exline, "LS", "", "");

            fun.dimrot1(dxf, v42, v29, 180, oal / 10, 1, height, arrowsize, exline, "APMX", "", "");

            fun.dimrot1(dxf, v12, v8, 180, oal / 5, 1, height, arrowsize, exline, "LU", "", "");

            fun.dimrot1(dxf, v11, v29, 180, oal / 3, 1, height, arrowsize, exline, "LF_1", "", "");

            fun.dimrot1(dxf, v11, v28, 180, oal / 2, 1, height, arrowsize, exline, "LF_2", "", "");

            fun.dimrot1(dxf, v12, v28, 180, oal / 2 + (v12.Y + v28.Y) / 2 - (v11.Y + v28.Y) / 2, 1, height, arrowsize, exline, "PL", "", "");







            //定义格式，路径导出
            dxf.DrawingVariables.AcadVer = DxfVersion.AutoCad2007;
            dxf.Save(path);


        }

    }
}